package builder;

import builder.builder.Meal;
import builder.builder.MealBuilder;

/**
 * 建造者模式
 * Packing接口为包装统一接口，Bottle、Wrapper分别为实现该接口的瓶子类，和纸盒类
 * Item为食品接口，Burger为实现该接口的汉堡包类，ColdDrink为实现该接口的冷饮类
 * Meal为餐类，包含Item列表属性，存放食品，另外有添加食品方法，以及计算总价方法
 * MealBuilder类为套餐提供类，建造者类，用于提供不同的套餐组合
 */
public class Main {
    public static void main(String[] args){
        MealBuilder mealBuilder = new MealBuilder();

        Meal vegMeal = mealBuilder.prepareVegMeal();
        System.out.println("Veg Meal:");
        vegMeal.showItems();
        System.out.println("Total Cost:" + vegMeal.getCost());

        Meal nonMeal = mealBuilder.prepareVegMeal();
        System.out.println("\n\nNon-Veg Meal:");
        nonMeal.showItems();
        System.out.println("Total Cost:" + nonMeal.getCost());
    }
}
